#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    char str1[100], str2[100];
    char* p1, * p2;

    cout << "Enter a string: ";
    cin.getline(str1, 100);

    p1 = str1;
    p2 = str2;

    while (*p1 != '\0')
    {
        if (*p1 != ' ')
        {
            *p2 = *p1;
            p2++;
        }
        p1++;
    }

    *p2 = '\0';

    cout << "String after removing spaces: " << str2 << endl;

    return 0;
}